//
//  CategoryListsCell.m
//  Tang
//
//  Created by 352324497@qq.com on 15/12/7.
//  Copyright © 2015年 352324497@qq.com. All rights reserved.
//

#import "CategoryListsCell.h"

@implementation CategoryListsCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        CGFloat height = frame.size.width * 330 / 600;
        self.pic = [[UIImageView alloc]initWithFrame:CGRectMake(10 * Kx6, 10 * Kx6, frame.size.width - 20 * Kx6, height)];
        self.pic.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_pic];
        
        self.title = [[UILabel alloc]initWithFrame:CGRectMake(10 * Kx6, height + 20 * Kx6, self.pic.frame.size.width, 30 * Kx6)];
        self.title.font = [UIFont systemFontOfSize:16 * Kx6];
        self.title.textColor = [UIColor darkGrayColor];
        self.title.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_title];
    }
    return self;
}

-(void)setModel:(CategoryListsModel *)model
{
    _model = model;
    [self.pic sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:[UIImage imageNamed:@"PCL"]];
    self.title.text = model.title;
}
@end
